
<!--修改子订单状态-->
<!--修改弹出框-->
<div class="wizard" id="wizard-edit">
    <form method="post">
        <h1>修改订单评审状态</h1>
        <div class="wizard-card" data-onValidated="setServerName" data-cardname="name">
            <h3><span>修改订单评审状态</span></h3>
            <!--<input type="hidden" name="oid_edit">-->
            <div class="wizard-input-section">
                <div class="form-group">
                    <label>生产状态</label>
                    <select name="is_status_e" id="is_status_e" class="form-control">
                        <option value="1">生产中</option>
                        <option value="0">已完成</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>客户名称</label>
                    <input type="text" class="form-control" readonly name="client_e" id="client_e" data-validate=""/>
                </div>
                <div class="form-group">
                    <label>配件</label>
                    <input type="text" class="form-control" readonly name="fitting_e" id="fitting_e" data-validate=""/>
                </div>
                <div class="form-group">
                    <label>订单评审号</label>
                    <input type="text" class="form-control" readonly name="oid_edit" id="oid_edit" data-validate=""/>
                </div>
                <div class="form-group">
                    <label>上级-订单评审号</label>
                    <input type="text" class="form-control" readonly name="parent_id_e" id="parent_id_e" data-validate=""/>
                </div>

            </div>
        </div>

    </form>
</div>
<!--修改弹出框-->
<script src="__JS__/jquery.js"></script>
<script type="text/javascript">
    function edit(oid) {
        $.post("{:url('Order/one')}",{oid:oid},function(data){
            //console.log(data);
            //修改子订单状态
            if(data) {
                $("input[name='oid_edit']").val(data[0].oid);
                /*基本信息*/
                $("input[name='client_e']").val(data[0].client);

                /*表计参数*/
                $("select[name='meter_id_e']").val(data[0].meter_id);
                $("input[name='parent_id_e']").val(data[0].parent_id)
                $("input[name='order_qty_e']").val(data[0].order_qty);
                /*配件信息*/
                $("input[name='fitting_e']").val(data[0].fitting);
                $("select[name='is_status_e']").val(data[0].is_status);
            }
        },'json');

        foredit.show()
        $('.wizard-cancel').text('取消');
        $('.wizard-cancel').addClass('calCancel')
        $('.wizard-back').addClass('forhid')
        $('.wizard-next').text('确定');

        foredit.on("submit", function(wizard) {
            setTimeout(function() {
                wizard.trigger("success");
                wizard.hideButtons();
                wizard._submitting = false;
                wizard.showSubmitCard("success");
                wizard.updateProgressBar(0);
            }, 3000);
            esave();
            foredit.reset().close();
            //刷新页面
            window.location.reload();
        });

    }
    function esave() {
        var oid = $("input[name='oid_edit']").val();
        var is_status = $("select[name='is_status_e']").val();

        var data = {'oid':oid,'is_status':is_status};
        //console.log(data)
        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "{:url('Order/esave')}",//url
            data: data,
            success: function (result) {
                //console.log(result)
                var code = result.code
                var msg = result.msg
                changeText(msg, code)
                //console.log('123'+code)
            },
            error:function (result) {
                var code = 0
                var msg = '服务器错误';
                changeText(msg, code)

            }
        });
    }

</script>
